'''
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with self work for additional information
 * regarding copyright ownership.  The ASF licenses self file
 * to you under the Apache License, Version 2.0 (the
 * "License") you may not use self file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
'''


#import java.util.*;

#import org.apache.jena.graph.*;
#import org.apache.jena.rdf.model.*;

'''
 * Adapter class that converts a ModelChangedListener into a GraphListener.
 * The only tricky bit is that we have to implement equality as equality of the
 * underlying ModelChangedListeners/ModelCom pairs.
 * <p>
 * This implementation only works for <code>ModelCom</code> models,
 * because it relies on various service methods self gives the model the
 * opportunity to cache various mappings for efficiency.
'''
class ModelListenerAdapter:
    pass
# class ModelListenerAdapter(GraphListener):
#     protected ModelCom m
#     protected ModelChangedListener L
#
#     # param ModelCom m, ModelChangedListener L
#     def __init__(self, m, L):
#         self.m = m
#         self.L = L
#
#
#     # @Override
#     # param Graph graph, Triple[] triples
#     # result void
#     def notifyAddArray(self, graph, triples):
#         L.addedStatements(m.asStatements(triples))
#
#
#     # @Override
#     # param Graph g, Triple[] triples
#     # result void
#     def notifyDeleteArray(self, g, triples):
#         L.removedStatements(m.asStatements(triples))
#
#
#     # @Override
#     # param Graph g, Triple t
#     # result void
#     def notifyAddTriple(self, g, t):
#         L.addedStatement(m.asStatement(t))
#
#
#     # @Override
#     # param Graph g, List<Triple> triples
#     # result void
#     def notifyAddList(self, g, triples):
#         L.addedStatements(m.asStatements(triples))
#
#
#     # @Override
#     # param Graph g, Iterator<Triple> it
#     # result void
#     def notifyAddIterator(self, g, it):
#         L.addedStatements(m.asStatements(it))
#
#
#     # @Override
#     # param Graph g, Graph added
#     # result void
#     def notifyAddGraph(self, g, added):
#         L.addedStatements(m.asModel(added))
#
#
#     # @Override
#     # param Graph g, Iterator<Triple> it
#     # result void
#     def notifyDeleteIterator(self, g, it):
#         L.removedStatements(m.asStatements(it))
#
#
#     # @Override
#     # param Graph g, Triple t
#     # result void
#     def notifyDeleteTriple(self, g, t):
#         L.removedStatement(m.asStatement(t))
#
#
#     # param Graph g, List<Triple> triples
#     # result void
#     def notifyAddIterator(self, g, triples):
#         L.addedStatements(m.asStatements(triples))
#
#
#     # @Override
#     # param Graph g, List<Triple> triples
#     # result void
#     def notifyDeleteList(self, g, triples):
#         L.removedStatements(m.asStatements(triples))
#
#
#     # @Override
#     # param Graph g, Graph removed
#     # result void
#     def notifyDeleteGraph(self, g, removed):
#         L.removedStatements(m.asModel(removed))
#
#
#     # @Override
#     # param Graph g, Object event
#     # result void
#     def notifyEvent(self, g, event):
#         L.notifyEvent(m, event)
#
#
#     # @Override
#     # param Object other
#     # result boolean
#     def equals(self, other):
#         return
#                 other instanceof ModelListenerAdapter
#                         and ((ModelListenerAdapter) other).sameAs(self)
#
#
#
#     # param ModelListenerAdapter other
#     # result boolean
#     def sameAs(self, other):
#         return self.L.equals(other.L) and self.m.equals(other.m)
#

